﻿<%@ Page Title="كل الموزعين الداخلين" Language="C#" MasterPageFile="~/companypart/CompanyMastermaster.master" AutoEventWireup="true" CodeFile="AllInternals.aspx.cs" Inherits="AllInternals" meta:resourcekey="PageResource1"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../jqModal.css" rel="stylesheet" type="text/css" />

   <%-- <script src="jquery-1.3.2.min.js" type="text/javascript"></script>--%>
    <script src="../jqModal.js" type="text/javascript"></script>
    <script type="text/javascript">

    function there() {

        $("#dialog").jqm({ modal: true }).jqmShow();


    }
    
      </script>
      <style type="text/css">
           .newzr3{
	background:  url('../images/Untitled-2_03.png') right ;
	height:20px;
	 background-repeat:no-repeat;
	 float:left;
	 margin-top:5px;
	 text-align: center;
	 padding-right:15px;
	 cursor:pointer;
	 font-family:Tahoma;
	 font-size:14px;
	 color:#003353;
	 text-decoration:none;
	 
}
.newzr3:hover{
	color: #00b4ff;
	background-image:url('../images/Untitled-2ho_03.png');
	background-repeat:no-repeat;

} 
           tr .tabbone4{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:right;
	
}
.adel4{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  right;
}
         .zr3 {
	background-image:url('../images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('../images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
.txt3
{
    border:1px solid black;
    }
       

        .jqmWindow {
    display: none;
    
    position: fixed;
    top: 17%;
    left: 50%;
    
    margin-left: -300px;
    width: 800px;
    
    background-color: #EEE;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}

.jqmOverlay { background-color: #000; }

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWindow 
{
     position: absolute;
     top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
            </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div dir="rtl">
        <asp:UpdatePanel ID="up1" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
            <ContentTemplate>
            <div  align="right">
   

 </div>
                <div >
                    <table width="540px" dir="rtl">
                       <tr>
                       <td style="padding:5px">
                           <asp:LinkButton ID="LinkButton1" style="float:left"  meta:resourceKey="adds" CssClass="newzr3"  PostBackUrl="~/companypart/AddInternal.aspx"  runat="server" />
                       </td>
                       
                       </tr>
                        <tr>
                        <td>
                        
                       
                <asp:GridView ID="GridView1" runat="server"
                    AutoGenerateColumns="False" Font-Bold="False" Font-Names="Arabic Typesetting"
                    Font-Size="Large"  AllowPaging="True" 
                     onrowcreated="GridView1_RowCreated" EnableModelValidation="True" GridLines="None"  >
                   
                  
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                            <div >
                                <table class="tab3" >
                                    <tr class="tabbone3">

                                     <td style="width:200px">
                                        
                                        <asp:Label ID="lblcname" runat="server" Text="اسم المتابع" meta:resourceKey="lblcompanyname" />
                                            
                                        </td>
                                        

                                         <td style="width:200px">
                                     
                                        <asp:Label ID="lbladress" runat="server" Text="معلومات عن المتابع" meta:resourceKey="lblorgdesc" />
                                            
                                        </td>
                                         <td style="width:50px">
                                    
                                     <asp:Label ID="lbledit" runat="server" Text="تعديل" meta:resourceKey="lbledit" />
                                            
                                        </td>
                                        <td style="width:50px">
                                   
                                    <asp:Label ID="lbldelete" runat="server" Text="حذف" meta:resourceKey="lbldelete"  />
                                            
                                        </td>






                                   <td style="width:100px">
                                   
                                    <asp:Label ID="Label1" runat="server" Text="إصدار الفواتير" meta:resourceKey="receipt"  />
                                            
                                        </td>
                                   
                                    
                                      
                                    
                                    
                                      
                                      
                                      
                                       
                                       
                                    </tr>
                                </table>
                                </div>
                            </HeaderTemplate>
                            <ItemTemplate>
                              
                                <asp:Panel ID="Panel9" runat="server" Direction="RightToLeft">
                                    <table class="tab3">
                                        <tr class="adel3">
                                      <td style="width:200px">
                                                <asp:Label  ID="Label5" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("name"))) %>' />
                                            </td>

                                             <td style="width:200px">
                                                <asp:Label  ID="Label4" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("internal "))) %>' />
                                            </td>
                                             <td style="width:50px">
                                             <asp:HyperLink runat="server" ID="edits" Text='تعديل' meta:resourceKey="lbledit"  NavigateUrl='<%# this.ResolveUrl("~/companypart/" + string.Format("EditInternal.aspx?uid={0}",Eval("id"))) %>'  />
                                            </td>
                                             <td style="width:50px">
                                             <asp:LinkButton ID="delete" meta:resourceKey="lbldelete" Text="حذف"  CommandArgument='<%#Eval("id") %>' ToolTip='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("mycount"))) %>' runat="server" OnClick="delete_Click"></asp:LinkButton>    
                                            </td>
                                        <td style="width:100px">
                                             <asp:HyperLink runat="server" ID="HyperLink1" Text="" meta:resourceKey="receipt"  NavigateUrl='<%# this.ResolveUrl("~/companypart/" + string.Format("InternalReceipts.aspx?internal={0}",Eval("id"))) %>'  />
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
                        TargetControlID="delete" 
                        ConfirmText="<%$ Resources:Resource, delconfirm %>"
                          />
                           
                                </asp:Panel>
                              
                            </ItemTemplate>
                        </asp:TemplateField>
                      
                    </Columns>
                </asp:GridView>
                 </td>
                        </tr>
                     
                    </table>
                </div>
                 
            </ContentTemplate>
       
          </asp:UpdatePanel>
    </div>
    
     
    <asp:SqlDataSource ID="CusSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT i.id, i.internal,i.name,count(ic.id) as mycount FROM [internal_distribution] i  left JOIN internal_copies ic ON (i.id = ic.internal_id) WHERE i.company_id = @company_id group by i.id, i.internal,i.name">
        <SelectParameters>
        <asp:SessionParameter Name="company_id" SessionField="company_id"  Type="Int32" />
        
        </SelectParameters>
        
        
        </asp:SqlDataSource>
</asp:Content>

